import json
from django.http import JsonResponse
from django.shortcuts import render

# Create your views here.

def clone(request):
    if request.method == 'GET': 

        context = {
            "defaultGitCloneParams": {
                "repoUrl": "git@gitee.com:bbxxone/autoble.git",
                "localRepoHub": "ansibleExample",
                "localRepoHome": "/Users/zhaojinhui/Desktop/Auto/autonsole"
            },
            "defaultGitCloneParamsStr": json.dumps({
                "repoUrl": "git@gitee.com:bbxxone/autoble.git",
                "localRepoHub": "ansibleExample",
                "localRepoHome": "/Users/zhaojinhui/Desktop/Auto/autonsole"
            }, indent=4)

        }
        print(context["defaultGitCloneParams"])
        print(context["defaultGitCloneParamsStr"])
        return render(request, "git/clone.html", context)
    if request.method == 'POST':

        context = {
            'status': 'success',
            'message': '数据已接收', 
        } 

        return JsonResponse(context) 
